package boot.spring.controller;

import boot.spring.pagemodel.MSG;
import boot.spring.po.DeviceApply;
import boot.spring.po.LeaveApply;
import boot.spring.service.DeviceService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;
import java.util.HashMap;
import java.util.Map;

/**
 * @author : gaofee
 * @date : 15:53 2022/1/16
 * @码云地址 : https://feege.gitee.io
 */

@Controller
public class DeviceController {
    @Autowired
   private DeviceService deviceservice;

    @ApiOperation("发起一个设备巡检流程")
    @RequestMapping(value = "/startdevice", method = RequestMethod.POST)
    @ResponseBody
    public MSG start_leave(DeviceApply apply, HttpSession session) {
        String userid = /*(String) session.getAttribute("username");*/"33";
        deviceservice.startWorkflow(apply, userid);
        return new MSG("sucess");
    }


}
